<?php
require_once '../../cofd/common.php';
$userid = $_GET['userid'] ?? null;
$password = $_GET['newpassword'] ?? null;
$sql = "UPDATE user SET password = '$password' WHERE id = $userid";
if($conn->query($sql)){
    echo json_encode(array('code' => 200,'msg' => '名字修改成功'),JSON_UNESCAPED_UNICODE);
}else{
    echo json_encode(array('code' => 400,'msg' => '名字修改失败'),JSON_UNESCAPED_UNICODE);
}
$conn -> close();